﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Surpass.Model.Dto.ResponseDto.ResponseModel.ResultModel;
using Surpass.Repository.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Surpass.Repository.IRepository;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Authorization;

namespace Surpass.Admin.Controllers
{
   
    [Route("api/[controller]")]
    [ApiController]
    public class MenuController : ControllerBase
    {
        private readonly ISysMenuRepository _sysMenuRepository;
        public MenuController(ISysMenuRepository sysMenuRepository)
        {
            _sysMenuRepository = sysMenuRepository;
        }
        [HttpGet,Route("menutree/{userid}")]
        public IActionResult GetMenuTree(long userid)
        {
            var result = new ResponseModel().Succeed(_sysMenuRepository.GetSysMenu(userid));
            return Ok(result);
        }
    }
}
